<?
if (!defined('IN_RJ')) die("Error 404");
if($cmd[1]=="mtv"){
	$sql=$DB->query("select F.*,m_id,m_title,m_title_ascii,m_singer from {$conf['prefix']}focus F left join {$conf['prefix']}media M on F.focus_media=M.m_id where focus_media<>'' and m_id in(select focus_media from {$conf['prefix']}focus where focus_type=6) order by focus_stt asc");
	$mtv_title=$lang['top_hit_mtv_month']." ".$conf['current_month'];
	$mtv_title_ascii=$func->title_2_ascii($mtv_title,true);
	if($DB->num_rows($sql)){
		$ro_mtv=$tpl->get_tpl("top_mtv");
		$t['row'] = $tpl->get_block_from_str($ro_mtv,'list_mtv.row',1);
		$html = '';
		while($song=$DB->fetch_row($sql)){
			$singer_name=$func->get_data('singer',$song['m_singer']);
			$html .= $tpl->assign_vars($t['row'],
				array(
				'song.TITLE'	=> $func->unhtmlchars($song['m_title']),
				'song.ID'		=> $song['m_id'],	
				'song.STT'		=> $song['focus_stt'],
				'song.SINGER_NAME' => $singer_name,
				'song.SINGER_URL' => $func->change_link('singer',$song['m_singer'],$func->title_2_ascii($singer_name,true)),
				'song.URL'		=> $func->change_link('song',$song['m_id'],$func->title_2_ascii($song['m_title_ascii'])),
				'song.ADD_PL'	=> $logged_in?"select_playlist({$song['m_id']});return false;":"guest_add_playlist({$song['m_id']});return false;",
				)
			);
		}
		$ro_mtv = $tpl->assign_vars($ro_mtv,
			array(
				'top_mtv.TITLE' => $mtv_title,
			)
		);
		
		$ro_mtv = $tpl->assign_blocks_content($ro_mtv,array(
				'list_mtv'	=>	$html,
			)
		);
	}else $ro_mtv=box_announcement($lang['no_data']);
	$main_content=$ro_mtv;
	$title_web_bar=$mtv_title;
	$title_ascii_web_bar=$mtv_title_ascii;
}
?>